<template>
    <div>
        <home-header></home-header>
         <home-swiper :swiper = 'swiper'></home-swiper>
         <home-icons :iconList = 'iconList'></home-icons>
         <home-recommend :recommend = 'recommend'></home-recommend>
         <hot-recommend :hotList = 'hotList'></hot-recommend>
         <home-week :weekList = 'weekList'></home-week>
    </div>
    
</template>
<script>
import HomeHeader from './components/Header'
import HomeSwiper from './components/Swiper'
import HomeIcons from './components/Icons'
import HomeRecommend from './components/Recommend'
import HotRecommend from './components/Hot'
import HomeWeek from './components/Week'
import axios from 'axios'
export default {
    name:'Home',
    components:{
        HomeHeader,
        HomeSwiper,
        HomeIcons,
        HomeRecommend,
        HotRecommend,
        HomeWeek
    },
    data(){
        return{
            swiper:[],
            iconList:[],
            recommend:[],
            hotList:[],
            weekList:[]
        }     
    },
    methods:{
        getHomeInfo(){
            axios.get('https://easy-mock.com/mock/5b4ee1efc7b80163e783efcc/example/tuniu/index')
                .then(this.getHomeInfoSucc)
        },
        getHomeInfoSucc(res){
            res = res.data
            const data = res.data
            this.swiper = data.swiperList
            this.iconList = data.IconList
            this.recommend = data.recommendList
            this.hotList = data.hotList
            this.weekList = data.weekList
        }
    },
    mounted(){
        this.getHomeInfo()
    }
}
</script>
<style scoped>

</style>
